import UIKit

//定义语法

class SomeClass {
    // class definition goes here
}
struct SomeStructure {
    // structure definition goes here
}


struct Resolution {
    var width = 0
    var height = 0
}
class VideoMode {
    var resolution = Resolution()
    var interlaced = false
    var frameRate = 0.0
    var name: String?
}


//实例

let someResolution = Resolution()
let someVideoMode = VideoMode()


//属性访问  点语法
print("The width of someResolution is \(someResolution.width)")
someVideoMode.resolution.width = 1280
print("The width of someVideoMode is now \(someVideoMode.resolution.width)")

//结构体类型的成员逐一构造器
//所有结构体都有一个自动生成的成员逐一构造器，用于初始化新结构体实例中成员的属性。新实例中各个属性的初始值可以通过属性的名称传递到成员逐一构造器之中：

let vga = Resolution(width: 640, height: 480)



















